package com.zyf.service.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zyf.service.entity.VideoEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(rollbackFor = Exception.class)
public class VideoServiceImpl extends ServiceImpl<VideoMapper, VideoEntity> implements IVideoService {

    @Override
    public VideoEntity findFileByName(String fileName) {
        LambdaQueryWrapper<VideoEntity> queryW = new LambdaQueryWrapper<>();
        queryW.eq(VideoEntity::getFileName, fileName);
        return this.getOne(queryW);
    }
}